//
//  iapLayer.h
//  fishGame
//
//  Created by Charles How on 12-4-17.
//  Copyright 2012年 hust. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"

#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>
#import "MKStoreManager.h"

#import <UIKit/UIView.h>
#import <UIKit/UIKitDefines.h>


#import "AdViewController.h"


#define OFFSET_SCREEN_TOP   (0)  ///与屏幕顶部的间距

#define IAP_MAX_ROWS   (2)   //最多显示的行数
#define IAP_MAX_COLS   (3)   //最多显示的列数
#define IAP_MAX_COUNT_PER_PAGE  (IAP_MAX_ROWS*IAP_MAX_COLS)



extern int player_money;
extern int player_level;  ///玩家的等级
extern int player_cur_level_fish_num;  ///玩家当前的等级所捕获的鱼的数量


#define IAP_COVER_LAYER_TAG   1000   ///灰色layer使原来的背景变暗
#define IAP_MENU_TAG   1001 
#define IAP_BACK_TAG	1002


enum IAP_MENU_ENUM {
	IAP_MENU_ITEM_GET_1000_COINS=0,
	IAP_MENU_ITEM_GET_5000_COINS,
	IAP_MENU_ITEM_GET_10000_COINS,
	IAP_MENU_ITEM_UP_1_GRADE,
	IAP_MENU_ITEM_UP_3_GRADE,
	IAP_MENU_ITEM_UP_10_GRADE,
	IAP_MENU_ITEM_IAP_MAX,
};


enum IAP_SPRITE_TAG {
    IAP_SPRITE_TAG_PIC_START = 10000,
    IAP_SPRITE_TAG_LAB_START = 20000
};


/*
 字体是我们在iPhone开发中经常需要用到的。但是iPhone里面到底内置了哪些字体呢？下面就是一个常用的列表。
 
 
 
 Family name: AppleGothic
 Font name: AppleGothic
 Family name: Hiragino Kaku Gothic ProN
 Font name: HiraKakuProN-W6
 Font name: HiraKakuProN-W3
 Family name: Arial Unicode MS
 Font name: ArialUnicodeMS
 Family name: Heiti K
 Font name: STHeitiK-Medium
 Font name: STHeitiK-Light
 Family name: DB LCD Temp
 Font name: DBLCDTempBlack
 Family name: Helvetica
 Font name: Helvetica-Oblique
 Font name: Helvetica-BoldOblique
 Font name: Helvetica
 Font name: Helvetica-Bold
 Family name: Marker Felt
 Font name: MarkerFelt-Thin
 Family name: Times New Roman
 Font name: TimesNewRomanPSMT
 Font name: TimesNewRomanPS-BoldMT
 Font name: TimesNewRomanPS-BoldItalicMT
 Font name: TimesNewRomanPS-ItalicMT
 Family name: Verdana
 Font name: Verdana-Bold
 Font name: Verdana-BoldItalic
 Font name: Verdana
 Font name: Verdana-Italic
 Family name: Georgia
 Font name: Georgia-Bold
 Font name: Georgia
 Font name: Georgia-BoldItalic
 Font name: Georgia-Italic
 Family name: Arial Rounded MT Bold
 Font name: ArialRoundedMTBold
 Family name: Trebuchet MS
 Font name: TrebuchetMS-Italic
 Font name: TrebuchetMS
 Font name: Trebuchet-BoldItalic
 Font name: TrebuchetMS-Bold
 Family name: Heiti TC
 Font name: STHeitiTC-Light
 Font name: STHeitiTC-Medium
 Family name: Geeza Pro
 Font name: GeezaPro-Bold
 Font name: GeezaPro
 Family name: Courier
 Font name: Courier
 Font name: Courier-BoldOblique
 Font name: Courier-Oblique
 Font name: Courier-Bold
 Family name: Arial
 Font name: ArialMT
 Font name: Arial-BoldMT
 Font name: Arial-BoldItalicMT
 Font name: Arial-ItalicMT
 Family name: Heiti J
 Font name: STHeitiJ-Medium
 Font name: STHeitiJ-Light
 Family name: Arial Hebrew
 Font name: ArialHebrew
 Font name: ArialHebrew-Bold
 Family name: Courier New
 Font name: CourierNewPS-BoldMT
 Font name: CourierNewPS-ItalicMT
 Font name: CourierNewPS-BoldItalicMT
 Font name: CourierNewPSMT
 Family name: Zapfino
 Font name: Zapfino
 Family name: American Typewriter
 Font name: AmericanTypewriter
 Font name: AmericanTypewriter-Bold
 Family name: Heiti SC
 Font name: STHeitiSC-Medium
 Font name: STHeitiSC-Light
 Family name: Helvetica Neue
 Font name: HelveticaNeue
 Font name: HelveticaNeue-Bold
 Family name: Thonburi
 Font name: Thonburi-Bold
 Font name: Thonburi
 */



@interface iapLayer : CCLayer<MKStoreKitDelegate,AdViewControllerDelegate>
{
	CCMenuItem	*disabledItem;
	
	NSMutableArray * menuItemArray;
	
	CCMenuItem *back;
	
	UIActivityIndicatorView * activityIndicatorView;
    
    CCMenu *menu;
    
    
    AdViewController	*adController;
}

@property(nonatomic,readwrite) UIActivityIndicatorView * activityIndicatorView;

-(void) menuCallback: (id) sender;
-(void) menuCallback2: (id) sender;


-(void)featureAButtonPressed;
-(void)featureBButtonPressed;
-(void)featureCButtonPressed;
-(void)featureDButtonPressed;

- (void)productAPurchased;
- (void)productBPurchased;




/*
 对UIImage进行缩放的函数
 */
-(UIImage *)resizeImage:(UIImage *)image andScaleX:(float)scaleX andScaleY:(float)scaleY;

@end